package com.bawei.week.user

import androidx.lifecycle.MutableLiveData
import com.bawei.lib_base.entity.UserBean
import com.bawei.lib_base.mvvm.BaseViewModel
import com.bawei.lib_base.utils.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class UserViewModel @Inject constructor(val apiService: ApiService) : BaseViewModel(){
    val userLoginSuc = MutableLiveData<UserBean>()

    val userRegisterSuc = MutableLiveData<UserBean>()

    fun getUserLogin(password : String,username : String){
        httpRetrofit({apiService.getUserLogin(password,username)},userLoginSuc :: postValue)
    }

    fun getUserRegister(password: String,username: String){
        httpRetrofit({apiService.getUserRegister(password,username)},userRegisterSuc :: postValue)
    }
}